<?php
$this->render('include/sortLink.phtml');
echo $this->render('resource/keyword/_tab.phtml');
$this->headScript()->appendFile(_STATIC_HTTP . '/jquery/checkAll.js');
?>
<form action="" method="post">
<div class="body">
	<table class="list">
		<tr>
			<th class="narrow"><?php echo '<input type="checkbox" name="select-all" id="select-all" value="1" rel="id[]" />';?></th>
			<th class="narrow sort"><?php echo __sortLink('id', '#');?></th>
			<th class="narrow sort" title="<?php echo $this->language('Is Actived');?>?"><?php echo __sortLink('active', 'A');?></th>
			<th class="narrow sort" title="<?php echo $this->language('Hit Day');?>"><?php echo __sortLink('day', 'HD');?></th>
			<th class="narrow sort" title="<?php echo $this->language('Hit Week');?>"><?php echo __sortLink('week', 'HW');?></th>
			<th class="narrow sort" title="<?php echo $this->language('Hit Month');?>"><?php echo __sortLink('month', 'HM');?></th>
			<th class="narrow sort" title="<?php echo $this->language('Hit Total');?>"><?php echo __sortLink('total', 'HT');?></th>
			<th><?php echo $this->language('NAME');?></th>
			<th class="id"></th>
		</tr>
		<?php foreach($this->list AS $key => $row) { ?>
		<tr>
			<td><?php
				if(in_array($row->getId(), $this->checkedList)) {
					$checked = array('checked' => 'checked');
				} else {
					$checked = array();
				}
				echo $this->form()->checkbox('id[]', $row->getId(), array_merge(array('id' => 'id-' . $row->getId()), $checked));
			?></td>
			<td><?php echo $row->getId();?></td>
			<td class="center"><?php echo $row->getIsActive() ? 'YES' : 'NO';?></td>
			<td class="center"><h3><?php echo $row->getHitDay();?></h3></td>
			<td class="center"><h3><?php echo $row->getHitWeek();?></h3></td>
			<td class="center"><h3><?php echo $row->getHitMonth();?></h3></td>
			<td class="center"><h3><?php echo $row->getHitTotal();?></h3></td>
			<td><a href="<?php echo $this->url('resource/keyword/edit', array('id' => $row->getId()));?>"><?php echo $this->escape($row->getName());?></a></td>
			<td></td>
		</tr>
		<?php } ?>
		<?php if(count($this->list) <= 0) {?>
		<tr>
			<td colspan="9" class="nohover">
				<div class="msg">
					<div class="common error" style="border:0;background:#fff;">
						<i class="icon"></i>
						<h4>STOP</h4>
						<div class="msg-bd">
							No Keyword found. 
							<a href="<?php echo $this->url('resource/keyword/addnew');?>"><?php echo $this->language('Create');?>..</a>
						</div>
					</div>
				</div>
			</td>
		</tr>
		<?php } ?>
		<tr>
			<th class="narrow"><?php echo '<input type="checkbox" name="select-all" id="select-all" value="1" rel="id[]" />';?></th>
			<th colspan="8"><?php 
				echo $this->render('include/deleteButton.phtml');
			?></th>
		</tr>
	</table>
</div>
</form>
<div class="body">
	<?php echo $this->paginator($this->list)->render();?>
</div>
